package com.suarte.core.hibernate;

import org.springframework.stereotype.Repository;
import org.appfuse.dao.hibernate.GenericDaoHibernate;
import com.suarte.core.dao.EmployeeTypeDao;
import com.suarte.core.EmployeeType;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Gcastillo
 * Date: Mar 13, 2011
 * Time: 11:06:46 AM
 * To change this template use File | Settings | File Templates.
 */

@Repository("employeeTypeDao")
public class EmployeeTypeDaoHibernate extends GenericDaoHibernate<EmployeeType, Long> implements EmployeeTypeDao {
    public EmployeeTypeDaoHibernate() {
        super(EmployeeType.class);
    }

    public List<EmployeeType> findByDescription(String description) {
        return getHibernateTemplate().find("from EmployeeType where description = ?", description);
    }

    public List<EmployeeType> findByDays(Integer days) {
        return getHibernateTemplate().find("from EmployeeType this where this.days = ?", days);
    }
}